from flask import Flask
app = Flask(__name__)
from views.data_upload import data_upload
from views.admin import admin
from views.msg_push import msg_push
from views.fw_update import fw_update
from views.report import report
from views.movie_list import movie_list
from views.frontend import frontend

app.config["DEBUG"] = True
blueprints=(
        ("data_upload","",data_upload),
        ("msg_push", "", msg_push),
        ("fw_update", "", fw_update),
        ("report", "", report),
        ("movie_list","", movie_list),
        ("frontend","",frontend),
        ("admin", "/admin", admin),
        )

for n,p,f in blueprints:
    app.register_blueprint(f,url_prefix=p)
#app.config["DEBUG"] = True
#app.run(debug=True)
application = app
if __name__ == "__main__":
    from gevent import monkey
    monkey.patch_all()
    from gevent.pywsgi import WSGIServer
    WSGIServer(('', 5000), app).serve_forever()

